let pPath = process.env.NODE_ENV === 'qa' ? '/wtoa/' : '/'
const px2rem = require('postcss-px2rem')
const postcss = px2rem({ remUnit: 16 })
console.log('env=', process.env.NODE_ENV)
console.log('pPath=', pPath)
module.exports = {
    publicPath: pPath,
    css: {
        loaderOptions: {
            postcss: {
                plugins: [postcss]
            }
        }
    },
    devServer: {
        proxy: {
            '/wtapi': {
                // target: 'http://127.0.0.1:8091', //local
                // target: 'http://139.219.15.206:8091', //online
                target: 'http://admin.dingshengtaiqiu.com', //qa
                // target: 'http://192.168.8.241:8091', //xiangou
                ws: true,
                secure: false, //使用http协议
                changeOrigin: true,
                pathRewrite: {
                    '^/wtapi': ''
                }
            }
        }
    }
}